// My nodeJS calculator
// Copyright (C) 2024  Rodion V. Saburov (Mern)
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

const prompt = require('prompt-sync')();

console.log('')
console.log('Welcome to my first nodejs calculator, \nmy name is: ')
console.log('||==|| ||=|| ||=||  ||=|| ||=|| ||   ||')
console.log('||==|| || || ||  ||   |   || || |||  ||')
console.log('|||    || || ||  ||   |   || || || | ||')
console.log('|| |   || || ||  ||   |   || || ||  |||')
console.log('||  || ||=|| ||=||  ||=|| ||=|| ||   ||')
console.log('')
var userName = prompt('What`s your name? ');
console.log('Hello, ' + userName + '!')

console.log('')

var firstNumber = parseInt(prompt("Enter first number: "))
var secondNumber = parseInt(prompt("Enter second number: "))

console.log('')

var symbol = prompt("Enter symbol(+,-,:,*): ")

if (symbol == "+"){
	console.log(userName + ', your solution = ' + firstNumber + secondNumber)
}else if (symbol == "-"){
	console.log(userName + ', your solution = ' + firstNumber - secondNumber)
}else if (symbol == ":"){
	console.log(userName + ', your solution = ' + firstNumber / secondNumber)
}else if (symbol == "*"){
	console.log(userName + ', your solution = ' + firstNumber * secondNumber)
}
